// void, Obj This, point pt
Hero this;
Obj o;
point dpt;  
int x, p;
bool bSquadTarget;

Sleep(10);
this = This.AsHero();
if(!.IsValid) return;

if(.HasArmy){
	.army.ClearDead;
	for (x = 0; x < .army.count; x += 1){
		if(.army[x].AsUnit.IsValid)
			if(.army[x].AsUnit.IsMilitary)
				if(.army[x].AsUnit.speed_factor < 100)
					.army[x].AsUnit.SetSpeedFactor(100);
	}
}

.FormSetupAndMoveTo (pt, 0, 0, true);

while(.HasPath()){
   .FormKeepMoving(1000);
}

dpt = .GetFinalPartyOrientation() - Point(1024, 1024);
if(dpt.x != 0 || dpt.y != 0)
	.Face(.pos + dpt);

if(.IsAlive)
if(.HasArmy)
if(.CmdCount == 1){
	if(!IsAIPlayer(.player)){
		.army.ClearDead;
		if(.army.count >= 40){
			for (x = 0; x < .army.count; x += 1){
				if(rand(10) == 1){
					.army[x].AsUnit.PlaySound("data/Sound Entities/UNIT_CONFIRM.XML");
					Sleep(rand(10)+10);
				}
			}
		}
	}
	if(IsAIPlayer(.player))
		.army.SetCommand("stand_position");
	.AddCommand(false, "stand_position");
}
